﻿using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace MM.Hash.UI
{
    public partial class MainPage : UserControl
    {
        private HashOperator op;

        public MainPage()
        {
            InitializeComponent();

            op = new HashOperator(inputFile, btnBrowse, pgbHash);
        }

        private void OnBrowsing(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Multiselect = false;
            dlg.Filter = "Any File|*.*";
            if (dlg.ShowDialog().Value)
            {
                op.Target = dlg.File;
                op.CalculateHash();
            }
        }

    }
}
